Skip to content

test: add an example of how to invoke Rspack#2846

Open
acozzette wants to merge 14 commits into
aspect-build:mainfrom
acozzette:rspack-example
Open

test: add an example of how to invoke Rspack#2846
acozzette wants to merge 14 commits into
aspect-build:mainfrom
acozzette:rspack-example

Conversation

@acozzette
Copy link
Copy Markdown
Contributor

This example started out as a test case by @jbedard and @nickschaap showing how js_run_binary can sometimes fail to work correctly when the execution and target platforms are different.

I was able to get it working, primarily by setting use_execroot_entry_point = False. The problem with the default behavior (use_execroot_entry_point = True) is that it runs target-platform sources during the build action, which can go haywire if the target platform is meaningfully different from the execution platform.

Getting all the sources in the right place and built for the right platform is not entirely straightforward, so I thought it would be good to have a simple example showing this. I added a lot of comments trying to explain why everything is set up the way it is.


Changes are visible to end-users: no

Test plan

  • New test cases added

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 15, 2026

Bazel 7 (Test)

257 test targets passed

Targets
//:npm_link_targets_node_modules_build_test [k8-fastbuild]                                               47ms
//js/private/test/coverage:pass [k8-fastbuild]                                                           131ms
//js/private/test/data:chdir-source-data-relative [k8-fastbuild]                                         142ms
//js/private/test/data:extract-write-generated [k8-fastbuild]                                            56ms
//js/private/test/data:extract-write-js_library-data [k8-fastbuild]                                      142ms
//js/private/test/data:from-genrule-data [k8-fastbuild]                                                  92ms
//js/private/test/data:from-js_library-srcs [k8-fastbuild]                                               77ms
//js/private/test/data:from-js_run_binary-genrule-copied [k8-fastbuild]                                  85ms
//js/private/test/data:from-js_run_binary-js_library-srcs [k8-fastbuild]                                 139ms
//js/private/test/data:from-js_run_binary-srcs [k8-fastbuild]                                            140ms
//js/private/test/fixed_args:args_test [k8-fastbuild]                                                    76ms
//js/private/test/fixed_args:locations_test [k8-fastbuild]                                               79ms
//js/private/test/fixed_args:locations_test_no_expand [k8-fastbuild]                                     73ms
//js/private/test/image/non_ascii:assert_custom_layer_groups_test_app_test [k8-fastbuild]                51ms
//js/private/test/image/non_ascii:assert_custom_layer_groups_test_node_modules_test [k8-fastbuild]       76ms
//js/private/test/image/non_ascii:assert_custom_layer_groups_test_package_store_3p_test [k8-fastbuild]   73ms
//js/private/test/image:assert_custom_layers_nomatch_test_node_modules_test [k8-fastbuild]               56ms
//js/private/test/image:assert_custom_layers_nomatch_test_package_store_3p_test [k8-fastbuild]           35ms
//js/private/test/image:assert_custom_owner_test_app_test [k8-fastbuild]                                 45ms
//js/private/test/image:assert_default_test_node_test [k8-fastbuild]                                     55ms
//js/private/test/image:assert_default_test_package_store_1p_test [k8-fastbuild]                         43ms
//js/private/test/image:assert_regex_edge_cases_test_odd_characters_test [k8-fastbuild]                  59ms
//js/private/test/js_binary_sh:BAZEL_BINDIR_change_directory_test [k8-fastbuild]                         81ms
//js/private/test/js_binary_sh:BAZEL_WORKSPACE_test [k8-fastbuild]                                       133ms
//js/private/test/js_binary_sh:JS_BINARY__PACKAGE_test [k8-fastbuild]                                    89ms
//js/private/test/js_binary_sh:JS_BINARY__TARGET_test [k8-fastbuild]                                     145ms
//js/private/test/js_binary_sh:env_json_obj_launcher_escaped [k8-fastbuild]                              124ms
//js/private/test/js_binary_sh:env_json_obj_value [k8-fastbuild]                                         140ms
//js/private/test/js_binary_sh:env_json_value [k8-fastbuild]                                             138ms
//js/private/test/js_binary_sh:regexy-args [k8-fastbuild]                                                46ms
//js/private/test/js_binary_sh:regexy-args-1 [k8-fastbuild]                                              138ms
//js/private/test/js_binary_sh:regexy-args-2 [k8-fastbuild]                                              119ms
//js/private/test/js_run_devserver:node_modules_symlink_to_execroot_test [k8-fastbuild]                  485ms
//js/private/test/no_copy_to_bin:no_copy_to_bin_test [k8-fastbuild]                                      161ms
//js/private/test/node-patches:escape_node22_test [k8-fastbuild]                                         100ms
//js/private/test/node-patches:lstat_node20_cjs_test [k8-fastbuild]                                      125ms
//js/private/test/node-patches:lstat_node20_test [k8-fastbuild]                                          146ms
//js/private/test/node-patches:lstat_node24_cjs_test [k8-fastbuild]                                      158ms
//js/private/test/node-patches:lstat_nodejs_test [k8-fastbuild]                                          174ms
//js/private/test/node-patches:opendir_node24_cjs_test [k8-fastbuild]                                    231ms
//js/private/test/node-patches:opendir_node24_test [k8-fastbuild]                                        193ms
//js/private/test/node-patches:readdir_node20_cjs_test [k8-fastbuild]                                    236ms
//js/private/test/node-patches:readdir_node22_test [k8-fastbuild]                                        245ms
//js/private/test/node-patches:readdir_node24_cjs_test [k8-fastbuild]                                    194ms
//js/private/test/node-patches:readdir_node24_test [k8-fastbuild]                                        215ms
//js/private/test/node-patches:readdir_nodejs_cjs_test [k8-fastbuild]                                    116ms
//js/private/test/node-patches:readlink_node20_test [k8-fastbuild]                                       160ms
//js/private/test/node-patches:readlink_node22_test [k8-fastbuild]                                       202ms
//js/private/test/node-patches:readlink_node24_cjs_test [k8-fastbuild]                                   136ms
//js/private/test/node-patches:realpath_node20_test [k8-fastbuild]                                       152ms
//js/private/test/node-patches:realpath_node22_cjs_test [k8-fastbuild]                                   149ms
//js/private/test/node-patches:realpath_node24_cjs_test [k8-fastbuild]                                   166ms
//js/private/test/node-patches:realpath_node24_test [k8-fastbuild]                                       198ms
//js/private/test/node-patches:realpath_nodejs_test [k8-fastbuild]                                       258ms
//js/private/test/proto:proto_args_test [k8-fastbuild]                                                   32ms
//js/private/test:data_in_runfiles_test [k8-fastbuild]                                                   26ms
//js/private/test:explicit_types_test [k8-fastbuild]                                                     75ms
//js/private/test:main_toolchain_24 [k8-fastbuild]                                                       163ms
//js/private/test:run_environment_info_tests_test_both_test [k8-fastbuild]                               44ms
//js/private/test:run_environment_info_tests_test_inherit_only_subject [k8-fastbuild]                    193ms
//js/private/watch:watch_checked_0_test [k8-fastbuild]                                                   65ms
//npm/private/test/npm_package:test_pkg [k8-fastbuild]                                                   48ms
//npm/private/test/npm_package:test_pkg_3 [k8-fastbuild]                                                 52ms
//npm/private/test/npm_package:test_pkg_4 [k8-fastbuild]                                                 54ms
//npm/private/test/npm_package:test_pkg_5 [k8-fastbuild]                                                 62ms
//npm/private/test/npm_package:test_pkg_6 [k8-fastbuild]                                                 50ms
//npm/private/test:__rollup-test [k8-fastbuild]                                                          381ms
//npm/private/test:npm_auth_tests_test_0 [k8-fastbuild]                                                  51ms
//npm/private/test:npm_auth_tests_test_2 [k8-fastbuild]                                                  56ms
//npm/private/test:npm_auth_tests_test_3 [k8-fastbuild]                                                  70ms
//npm/private/test:test_generated_pkg_json___rollup-target__entry_point_tagged_manual [k8-fastbuild]     111ms
//npm/private/test:test_generated_pkg_json___rollup-target_copy_srcs_to_bin_tagged_manual [k8-fastbuild] 44ms
//npm/private/test:test_npm_package_visibility_test_14 [k8-fastbuild]                                    90ms
//npm/private/test:test_npm_package_visibility_test_2 [k8-fastbuild]                                     54ms
//npm/private/test:test_npm_package_visibility_test_3 [k8-fastbuild]                                     62ms
//npm/private/test:test_npm_package_visibility_test_5 [k8-fastbuild]                                     82ms
//npm/private/test:test_npm_package_visibility_test_6 [k8-fastbuild]                                     32ms
//npm/private/test:test_npm_package_visibility_test_8 [k8-fastbuild]                                     101ms
//npm/private/test:test_npmrc_test_1 [k8-fastbuild]                                                      76ms
//npm/private/test:test_npmrc_test_2 [k8-fastbuild]                                                      73ms
//npm/private/test:test_npmrc_test_3 [k8-fastbuild]                                                      70ms
//npm/private/test:test_npmrc_test_5 [k8-fastbuild]                                                      98ms
//npm/private/test:test_npmrc_test_7 [k8-fastbuild]                                                      29ms
//npm/private/test:test_parse_pnpm_lock_test_2 [k8-fastbuild]                                            69ms
//npm/private/test:test_pnpm_test_1 [k8-fastbuild]                                                       33ms
//npm/private/test:test_pnpm_test_12 [k8-fastbuild]                                                      56ms
//npm/private/test:test_pnpm_test_2 [k8-fastbuild]                                                       76ms
//npm/private/test:test_pnpm_test_3 [k8-fastbuild]                                                       91ms
//npm/private/test:test_pnpm_test_6 [k8-fastbuild]                                                       88ms
//npm/private/test:test_pnpm_test_7 [k8-fastbuild]                                                       45ms
//npm/private/test:test_pnpm_test_8 [k8-fastbuild]                                                       81ms
//npm/private/test:test_pnpm_test_9 [k8-fastbuild]                                                       91ms
//npm/private/test:test_transitive_closure_test_0 [k8-fastbuild]                                         74ms
//npm/private/test:test_translate_lock_test_0 [k8-fastbuild]                                             50ms
//npm/private/test:test_translate_lock_test_3 [k8-fastbuild]                                             67ms
//npm/private/test:test_utils_test_0 [k8-fastbuild]                                                      31ms
//npm/private/test:test_utils_test_4 [k8-fastbuild]                                                      45ms
//npm/private/test:test_utils_test_6 [k8-fastbuild]                                                      59ms
//npm/private/test:write_npm_translate_lock_0_test [k8-fastbuild]                                        131ms
//npm/private/test:write_npm_translate_lock_1_test [k8-fastbuild]                                        91ms
+ 157 other targets

Bazel 8 (Test)

All tests were cache hits

217 tests (100.0%) were fully cached saving 27s.


Bazel 9 (Test)

All tests were cache hits

217 tests (100.0%) were fully cached saving 30s.


Bazel 7 (Test)

e2e/bzlmod

Waiting for runner...


Bazel 8 (Test)

e2e/bzlmod

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/bzlmod

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/git_dep_metadata

1 test target passed

Targets
//:no_git_metadata_test                                                                                  20ms

Bazel 8 (Test)

e2e/git_dep_metadata

Waiting for runner...


Bazel 9 (Test)

e2e/git_dep_metadata

Waiting for runner...


Bazel 7 (Test)

e2e/gyp_no_install_script

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   52ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                   55ms

Bazel 8 (Test)

e2e/gyp_no_install_script

Waiting for runner...


Bazel 9 (Test)

e2e/gyp_no_install_script

All tests were cache hits

1 test (100.0%) was fully cached saving 46ms.


Bazel 7 (Test)

e2e/js_binary_workspace

Waiting for runner...


Bazel 8 (Test)

e2e/js_binary_workspace

Waiting for runner...


Bazel 9 (Test)

e2e/js_binary_workspace

All tests were cache hits

4 tests (100.0%) were fully cached saving 238ms.


Bazel 8 (Test)

e2e/js_image_oci

Waiting for runner...


Bazel 9 (Test)

e2e/js_image_oci

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/nextjs

3 test targets passed

Targets
//v15/cjs:test [k8-fastbuild]                                                                            25ms
//v15/esm:test [k8-fastbuild]                                                                            29ms
//v15/mjs:test [k8-fastbuild]                                                                            50ms

Bazel 8 (Test)

e2e/nextjs

All tests were cache hits

3 tests (100.0%) were fully cached saving 94ms.


Bazel 9 (Test)

e2e/nextjs

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_link_package

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/npm_link_package

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_link_package

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_link_package-rerooted

Waiting for runner...


Bazel 8 (Test)

e2e/npm_link_package-rerooted

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_link_package-rerooted

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_translate_lock

Waiting for runner...


Bazel 8 (Test)

e2e/npm_translate_lock

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_translate_lock

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_translate_lock_disable_hooks

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/npm_translate_lock_disable_hooks

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_translate_lock_disable_hooks

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_translate_lock_empty

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/npm_translate_lock_empty

Waiting for runner...


Bazel 9 (Test)

e2e/npm_translate_lock_empty

All tests were cache hits

2 tests (100.0%) were fully cached saving 105ms.


Bazel 7 (Test)

e2e/npm_translate_lock_exclude_package_contents

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/npm_translate_lock_exclude_package_contents

Waiting for runner...


Bazel 9 (Test)

e2e/npm_translate_lock_exclude_package_contents

Waiting for runner...


Bazel 7 (Test)

e2e/npm_translate_lock_multi

Waiting for runner...


Bazel 8 (Test)

e2e/npm_translate_lock_multi

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_translate_lock_multi

Waiting for runner...


Bazel 7 (Test)

e2e/npm_translate_lock_partial_clone

Waiting for runner...


Bazel 8 (Test)

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Bazel 9 (Test)

e2e/npm_translate_lock_partial_clone

Waiting for runner...


Bazel 7 (Test)

e2e/npm_translate_lock_replace_packages

Waiting for runner...


Bazel 8 (Test)

e2e/npm_translate_lock_replace_packages

Waiting for runner...


Bazel 9 (Test)

e2e/npm_translate_lock_replace_packages

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_translate_lock_subdir_patch

1 test target passed

Targets
//subdir:test                                                                                            53ms

Bazel 8 (Test)

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 67ms.


Bazel 9 (Test)

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 50ms.


Bazel 7 (Test)

e2e/npm_translate_package_lock

Waiting for runner...


Bazel 8 (Test)

e2e/npm_translate_package_lock

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/npm_translate_package_lock

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/npm_translate_yarn_lock

1 test target passed

Targets
//:test                                                                                                  19ms

Bazel 8 (Test)

e2e/npm_translate_yarn_lock

Waiting for runner...


Bazel 9 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/output_paths

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   76ms
//:test_lessc--help [k8-fastbuild]                                                                       41ms

Bazel 8 (Test)

e2e/output_paths

All tests were cache hits

2 tests (100.0%) were fully cached saving 252ms.


Bazel 9 (Test)

e2e/output_paths

Waiting for runner...


Bazel 7 (Test)

e2e/patch_from_repo

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/pnpm_lockfiles

59 test targets passed

Targets
//cases/docusaurus-direct-peer-v9:docusaurus_direct_with_peers [k8-fastbuild]                            35ms
//cases/isaacs-cliui-v90:isaacs_cliui [k8-fastbuild]                                                     75ms
//cases/multi-document-v11:multi_document_v11 [k8-fastbuild]                                             48ms
//cases/nested-peer-v9:nested_peers_targets [k8-fastbuild]                                               49ms
//cases/override-with-alias-url-v9:override-with-alias-url-v9 [k8-fastbuild]                             75ms
//cases/versionless-patch-v9:versionless_patch_targets [k8-fastbuild]                                    37ms
//cases/versionless-patch-v9:versionless_patch_test [k8-fastbuild]                                       241ms
//cases/workspace-peer-v9:optional_peers_targets [k8-fastbuild]                                          52ms
//v101:aliases-test [k8-fastbuild]                                                                       184ms
//v101:patch-test [k8-fastbuild]                                                                         82ms
//v101:repos_0_test [k8-fastbuild]                                                                       53ms
//v101:repos_10_test [k8-fastbuild]                                                                      60ms
//v101:repos_11_test [k8-fastbuild]                                                                      75ms
//v101:repos_12_test [k8-fastbuild]                                                                      64ms
//v101:repos_13_test [k8-fastbuild]                                                                      74ms
//v101:repos_1_test [k8-fastbuild]                                                                       55ms
//v101:repos_2_test [k8-fastbuild]                                                                       45ms
//v101:repos_3_test [k8-fastbuild]                                                                       41ms
//v101:repos_4_test [k8-fastbuild]                                                                       58ms
//v101:repos_5_test [k8-fastbuild]                                                                       72ms
//v101:repos_6_test [k8-fastbuild]                                                                       50ms
//v101:repos_7_test [k8-fastbuild]                                                                       43ms
//v101:repos_8_test [k8-fastbuild]                                                                       50ms
//v101:repos_9_test [k8-fastbuild]                                                                       56ms
//v101:targets [k8-fastbuild]                                                                            60ms
//v110:aliases-test [k8-fastbuild]                                                                       251ms
//v110:patch-test [k8-fastbuild]                                                                         177ms
//v110:repos_0_test [k8-fastbuild]                                                                       46ms
//v110:repos_10_test [k8-fastbuild]                                                                      45ms
//v110:repos_11_test [k8-fastbuild]                                                                      54ms
//v110:repos_12_test [k8-fastbuild]                                                                      48ms
//v110:repos_13_test [k8-fastbuild]                                                                      57ms
//v110:repos_1_test [k8-fastbuild]                                                                       61ms
//v110:repos_2_test [k8-fastbuild]                                                                       73ms
//v110:repos_3_test [k8-fastbuild]                                                                       54ms
//v110:repos_4_test [k8-fastbuild]                                                                       49ms
//v110:repos_5_test [k8-fastbuild]                                                                       73ms
//v110:repos_6_test [k8-fastbuild]                                                                       68ms
//v110:repos_7_test [k8-fastbuild]                                                                       71ms
//v110:repos_8_test [k8-fastbuild]                                                                       76ms
//v110:repos_9_test [k8-fastbuild]                                                                       45ms
//v110:targets [k8-fastbuild]                                                                            20ms
//v90:aliases-test [k8-fastbuild]                                                                        92ms
//v90:patch-test [k8-fastbuild]                                                                          89ms
//v90:repos_0_test [k8-fastbuild]                                                                        72ms
//v90:repos_10_test [k8-fastbuild]                                                                       50ms
//v90:repos_11_test [k8-fastbuild]                                                                       53ms
//v90:repos_12_test [k8-fastbuild]                                                                       53ms
//v90:repos_13_test [k8-fastbuild]                                                                       45ms
//v90:repos_1_test [k8-fastbuild]                                                                        72ms
//v90:repos_2_test [k8-fastbuild]                                                                        41ms
//v90:repos_3_test [k8-fastbuild]                                                                        67ms
//v90:repos_4_test [k8-fastbuild]                                                                        47ms
//v90:repos_5_test [k8-fastbuild]                                                                        41ms
//v90:repos_6_test [k8-fastbuild]                                                                        44ms
//v90:repos_7_test [k8-fastbuild]                                                                        55ms
//v90:repos_8_test [k8-fastbuild]                                                                        52ms
//v90:repos_9_test [k8-fastbuild]                                                                        51ms
//v90:targets [k8-fastbuild]                                                                             17ms

Bazel 8 (Test)

e2e/pnpm_lockfiles

Waiting for runner...


Bazel 9 (Test)

e2e/pnpm_lockfiles

All tests were cache hits

17 tests (100.0%) were fully cached saving 1s.


Bazel 7 (Test)

e2e/pnpm_repo_install

Waiting for runner...


Bazel 8 (Test)

e2e/pnpm_repo_install

Waiting for runner...


Bazel 9 (Test)

e2e/pnpm_repo_install

Waiting for runner...


Bazel 7 (Test)

e2e/pnpm_workspace

15 test targets passed

Targets
//:node_test [k8-fastbuild]                                                                              318ms
//:repos_test [k8-fastbuild]                                                                             66ms
//:vendored [k8-fastbuild]                                                                               35ms
//app/a:aspect_test_a_bin_test [k8-fastbuild]                                                            227ms
//app/a:npm_link_targets_node_modules_build_test [k8-fastbuild]                                          53ms
//app/a:npm_link_targets_test [k8-fastbuild]                                                             79ms
//app/a:test [k8-fastbuild]                                                                              145ms
//app/b:aliases [k8-fastbuild]                                                                           47ms
//app/b:test [k8-fastbuild]                                                                              158ms
//app/c:aspect_test_a_bin_test [k8-fastbuild]                                                            122ms
//app/c:test [k8-fastbuild]                                                                              140ms
//app/d:test [k8-fastbuild]                                                                              212ms
//lib/a:vendored [k8-fastbuild]                                                                          49ms
//lib/b:aliases [k8-fastbuild]                                                                           69ms
//lib/d:aliases [k8-fastbuild]                                                                           65ms

Bazel 8 (Test)

e2e/pnpm_workspace

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/pnpm_workspace

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/pnpm_workspace_deps

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/pnpm_workspace_deps

Waiting for runner...


Bazel 9 (Test)

e2e/pnpm_workspace_deps

Waiting for runner...


Bazel 7 (Test)

e2e/pnpm_workspace_rerooted

Waiting for runner...


Bazel 8 (Test)

e2e/pnpm_workspace_rerooted

Waiting for runner...


Bazel 9 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/protobuf-es

3 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   228ms
//:test_connect [k8-fastbuild]                                                                           301ms
//:test_connect_query [k8-fastbuild]                                                                     345ms

Bazel 8 (Test)

e2e/protobuf-es

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/protobuf-es

Waiting for runner...


Bazel 7 (Test)

e2e/protobuf-google

Waiting for runner...


Bazel 8 (Test)

e2e/protobuf-google

Waiting for runner...


Bazel 9 (Test)

e2e/protobuf-google

Waiting for runner...


Bazel 7 (Test)

e2e/repo_mapping

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/repo_mapping

Waiting for runner...


Bazel 9 (Test)

e2e/repo_mapping

Buildkite build #12739 is running...


Bazel 7 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 8 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 9 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 7 (Test)

e2e/vendored_tarfile

Buildkite build #12739 is running...


Bazel 8 (Test)

e2e/vendored_tarfile

Waiting for runner...


Bazel 9 (Test)

e2e/vendored_tarfile

Waiting for runner...


Bazel 7 (Test)

e2e/verify_patches

Waiting for runner...


Bazel 8 (Test)

e2e/verify_patches

Buildkite build #12739 is running...


Bazel 9 (Test)

e2e/verify_patches

All tests were cache hits

2 tests (100.0%) were fully cached saving 120ms.


Bazel 7 (Test)

examples

84 test targets passed

Targets
//:linked_packages_build_test [k8-fastbuild]                                                             55ms
//coverage:coverage [k8-fastbuild]                                                                       130ms
//genrule:test_acorn [k8-fastbuild]                                                                      119ms
//genrule:test_require_acorn [k8-fastbuild]                                                              46ms
//js_binary:aspect_bin_a_test [k8-fastbuild]                                                             119ms
//js_binary:case7_test [k8-fastbuild]                                                                    154ms
//js_binary:npm_version_test [k8-fastbuild]                                                              357ms
//js_binary:test13-1_cjs [k8-fastbuild]                                                                  66ms
//js_binary:test13-1_mjs [k8-fastbuild]                                                                  61ms
//js_binary:test13-2_cjs [k8-fastbuild]                                                                  57ms
//js_binary:test13-2_mjs [k8-fastbuild]                                                                  43ms
//js_binary:test4-b_cjs [k8-fastbuild]                                                                   40ms
//js_binary:test4-b_mjs [k8-fastbuild]                                                                   40ms
//js_binary:test4-cjs-a [k8-fastbuild]                                                                   32ms
//js_binary:test4-mjs-a [k8-fastbuild]                                                                   47ms
//js_binary:test5_cjs [k8-fastbuild]                                                                     56ms
//js_binary:test5_mjs [k8-fastbuild]                                                                     37ms
//js_binary:test6 [k8-fastbuild]                                                                         45ms
//js_binary:test6_alt [k8-fastbuild]                                                                     77ms
//js_binary:test8 [k8-fastbuild]                                                                         51ms
//js_binary:test_cjs [k8-fastbuild]                                                                      87ms
//js_binary:test_exitcode [k8-fastbuild]                                                                 70ms
//js_binary:test_js_binary_under_custom_rule [k8-fastbuild]                                              43ms
//js_binary:test_js_binary_under_custom_rule_local [k8-fastbuild]                                        57ms
//js_binary:test_js_binary_under_genrule_cjs [k8-fastbuild]                                              53ms
//js_binary:test_js_binary_under_genrule_mjs [k8-fastbuild]                                              44ms
//js_binary:test_js_binary_under_js_run_binary_cjs [k8-fastbuild]                                        51ms
//js_binary:test_js_binary_under_js_run_binary_local_cjs [k8-fastbuild]                                  57ms
//js_binary:test_js_binary_under_js_run_binary_local_mjs [k8-fastbuild]                                  41ms
//js_binary:test_js_binary_under_js_run_binary_mjs [k8-fastbuild]                                        67ms
//js_binary:test_js_binary_under_js_run_binary_no_copy_data_to_bin [k8-fastbuild]                        49ms
//js_binary:test_mjs [k8-fastbuild]                                                                      130ms
//js_binary:test_stderr [k8-fastbuild]                                                                   54ms
//js_binary:test_stdout [k8-fastbuild]                                                                   40ms
//js_lib_pkg/b:test_each_target [k8-fastbuild]                                                           160ms
//js_lib_pkg/b:test_parent_target [k8-fastbuild]                                                         85ms
//js_library/two:two_test [k8-fastbuild]                                                                 101ms
//linked_consumer:direct [k8-fastbuild]                                                                  105ms
//linked_consumer:pkg [k8-fastbuild]                                                                     142ms
//linked_consumer:sources_test [k8-fastbuild]                                                            43ms
//linked_consumer:types_test [k8-fastbuild]                                                              42ms
//linked_empty_node_modules:test [k8-fastbuild]                                                          31ms
//macro:test_all [k8-fastbuild]                                                                          430ms
//macro:test_cjs [k8-fastbuild]                                                                          472ms
//macro:test_esm [k8-fastbuild]                                                                          499ms
//macro:test_js [k8-fastbuild]                                                                           472ms
//nextjs:next_build_test [k8-fastbuild]                                                                  33ms
//nextjs:write_next_links_defs_test [k8-fastbuild]                                                       63ms
//npm_deps/patches:patches_update_test [k8-fastbuild]                                                    79ms
//npm_deps:circular_deps_build_test [k8-fastbuild]                                                       50ms
//npm_deps:rollup_version_test [k8-fastbuild]                                                            164ms
//npm_deps:test1 [k8-fastbuild]                                                                          39ms
//npm_deps:test10_cjs [k8-fastbuild]                                                                     217ms
//npm_deps:test10_mjs [k8-fastbuild]                                                                     203ms
//npm_deps:test11_cjs [k8-fastbuild]                                                                     165ms
//npm_deps:test11_mjs [k8-fastbuild]                                                                     195ms
//npm_deps:test3 [k8-fastbuild]                                                                          121ms
//npm_deps:test4 [k8-fastbuild]                                                                          126ms
//npm_deps:test5 [k8-fastbuild]                                                                          34ms
//npm_deps:test5_alt [k8-fastbuild]                                                                      34ms
//npm_deps:test6 [k8-fastbuild]                                                                          114ms
//npm_deps:test7_a [k8-fastbuild]                                                                        141ms
//npm_deps:test7_b_cjs [k8-fastbuild]                                                                    148ms
//npm_deps:test7_b_mjs [k8-fastbuild]                                                                    145ms
//npm_deps:test8 [k8-fastbuild]                                                                          123ms
//npm_deps:test9_cjs [k8-fastbuild]                                                                      123ms
//npm_deps:test9_mjs [k8-fastbuild]                                                                      164ms
//npm_deps:test_peer [k8-fastbuild]                                                                      216ms
//npm_deps:test_uvu_version [k8-fastbuild]                                                               224ms
//package_json_module:test [k8-fastbuild]                                                                408ms
//rspack:build_test [k8-fastbuild]                                                                       37ms
//runfiles:module_name_runfiles [k8-fastbuild]                                                           102ms
//runfiles:outer_runfiles [k8-fastbuild]                                                                 193ms
//runfiles:run_outer_binary_asserts__direct_srcs [k8-fastbuild]                                          70ms
//runfiles:run_outer_binary_asserts__transitive_data [k8-fastbuild]                                      65ms
//runfiles:run_test_binary_asserts__direct_srcs [k8-fastbuild]                                           84ms
//runfiles:run_test_binary_asserts__transitive_data [k8-fastbuild]                                       67ms
//runfiles:runfiles [k8-fastbuild]                                                                       184ms
//stack_traces:stack_traces [k8-fastbuild]                                                               210ms
//stamped_package_json:stamp_test [k8-fastbuild]                                                         47ms
//vite3:build_test [k8-fastbuild]                                                                        53ms
//vite6:build_test [k8-fastbuild]                                                                        50ms
//webpack_cli:test [k8-fastbuild]                                                                        335ms
//worker:test_pi [k8-fastbuild]                                                                          75ms

Bazel 8 (Test)

examples

All tests were cache hits

82 tests (100.0%) were fully cached saving 11s.


Bazel 9 (Test)

examples

All tests were cache hits

82 tests (100.0%) were fully cached saving 12s.


Buildifier      Format

@acozzette acozzette marked this pull request as ready for review May 15, 2026 04:45
@acozzette acozzette requested a review from jbedard May 15, 2026 04:46

module.exports = defineConfig({
entry: {
main: './rspack_entry.js',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is rspack resolving this from the current working directory or relative to the config file since the config file will live in a separate bazel-out tree than than this entrypoint

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's resolving it from the current working directory. js_run_binary's working directory is basically "bazel-out/<target platform>/bin/" + chdir where in this case chdir is "rspack".

For the output path below, I did have to replace __dirname with process.cwd() to reflect that the config file is no longer placed in the target platform bin directory.

@jbedard jbedard requested a review from nickschaap May 17, 2026 02:21
acozzette and others added 4 commits May 18, 2026 14:36
This example started out as a test case by @jbedard and @nickschaap showing how
`js_run_binary` can sometimes fail to work correctly when the execution and
target platforms are different.

I was able to get it working, primarily by setting `use_execroot_entry_point =
False`. The problem with the default behavior (`use_execroot_entry_point =
True`) is that it runs target-platform sources during the build action, which
can go haywire if the target platform is meaningfully different from the
execution platform.

Getting all the sources in the right place and built for the right platform is
not entirely straightforward, so I thought it would be good to have a simple
example showing this. I added a lot of comments trying to explain why
everything is set up the way it is.
…tform separation

For webpack and rollup invocations, configs and their npm plugin/loader
dependencies now live in the tool binary's runfiles rather than being
passed as target-platform action inputs. This ensures all exec-platform
code runs from the same runfiles tree, avoiding resolution failures in
cross-platform builds.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@acozzette
Copy link
Copy Markdown
Contributor Author

I went ahead and updated a bunch of other examples in the repo to use this same pattern. Luckily it was easy to just point Claude at the original example and ask it to imitate that.

@jbedard
Copy link
Copy Markdown
Member

jbedard commented May 19, 2026

I think we need to find a way to still directly invoke vite_bin.vite() and not force vite_bin.vite_binary() + js_run_binary.

Wrapping things like tool config files+deps into js_library is fine though, imo.

@acozzette
Copy link
Copy Markdown
Contributor Author

I tweaked things so that now we are down to just one js_library for the config and one call to vite_bin.bin() (or whatever the particular tool might be).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants